/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
 */

package toolcbc

import (
	bss "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/bss/v2"
)

type MyBssClient struct {
	BssClient *bss.BssClient
}

// 查询客户信用额度
func (myClient *MyBssClient) queryCloudCreditCoupons(request *QueryCloudCreditCouponsRequest) (*QueryCloudCreditCouponsResponse, error) {
	requestDef := GenReqDefForQueryCreditCoupons()
	if resp, err := myClient.BssClient.HcClient.Sync(request, requestDef); err != nil {
		return nil, err
	} else {
		return resp.(*QueryCloudCreditCouponsResponse), nil
	}
}

// 调整客户信用额度
func (myClient *MyBssClient) adjustCloudCreditCoupon(request *AdjustCloudCreditCouponRequest) (*AdjustCloudCreditCouponReponse, error) {
	requestDef := GenReqDefForAdjustCloudCreditCoupon()
	if resp, err := myClient.BssClient.HcClient.Sync(request, requestDef); err != nil {
		return nil, err
	} else {
		return resp.(*AdjustCloudCreditCouponReponse), nil
	}
}

// 查询调整客户信用额度
func (myClient *MyBssClient) queryCloudCreditRecord(request *QueryCloudCreditRecordRequest) (*QueryCloudCreditRecordResponse, error) {
	requestDef := GenReqDefForQueryCloudCreditRecord()
	if resp, err := myClient.BssClient.HcClient.Sync(request, requestDef); err != nil {
		return nil, err
	} else {
		return resp.(*QueryCloudCreditRecordResponse), nil
	}
}
